﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ThreadingPrimeNumberSample.Core;

namespace ThreadingPrimeNumberSample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void ShowPrimeCodeBehind_Click(object sender, RoutedEventArgs e)
        {
            new PrimeCodeBehind().Show();
        }

        private void ShowPrimeMVVM_Click(object sender, RoutedEventArgs e)
        {
            var window = new PrimeMVVM
                             {
                                 DataContext =
                                     new PrimeMVVMViewModel(
                                        new PrimeEngine(), 
                                        new ThreadProxy())
                             };
            window.Show();
        }

        private void GCCollect_Click(object sender, RoutedEventArgs e)
        {
            GC.Collect();
            GC.WaitForFullGCComplete();
            GC.Collect();
        }
    }
}
